package access;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class DataInputTest {

	public static void main(String[] args) throws IOException {
		
		InputStream in = new FileInputStream( "data-output.dat" );
		
		DataInputStream dis = new DataInputStream( in ) ;
		
		System.out.println( "available : " + dis.available() );
		
		byte a = dis.readByte();
		System.out.println( "byte : " + a + " , available : " + dis.available() );
		
		short b = dis.readShort();
		System.out.println( "short : " + b + " , available : " + dis.available() );
		
		int c = dis.readInt();
		System.out.println( "int : " + c + " , available : " + dis.available() );
		
		long d = dis.readLong();
		System.out.println( "long : " + d + " , available : " + dis.available() );
		
		float e = dis.readFloat();
		System.out.println( "float : " + e + " , available : " + dis.available() );
		
		
		double f = dis.readDouble();
		System.out.println( "double : " + f + " , available : " + dis.available() );
		
		
		char g = dis.readChar();
		System.out.println( "char : " + g + " , available : " + dis.available() );
		
		
		boolean h = dis.readBoolean();
		System.out.println( "boolean : " + h + " , available : " + dis.available() );
		
		
		
		System.out.println( );
		
		dis.close();
		in.close();

	}

}
